#include <iostream>
#include <vector>
using namespace std;

short check(vector<bool> vec,int a,int b)
{
    unsigned int j=vec.size();
    for(unsigned int i=0;i<j;i++)
    {
        if(vec[i])
        {
            j = i;
            break;
        }
    }
    if(vec.size()-j>=a)
    {
        return 0;
    }
    if(j == vec.size())
    {
        return 2;
    }
    return 1;
}

vector<bool> overturn(vector<bool> vec,int num,int a,int b)
{
    unsigned int i=0;
    vector<bool> result = vec;
    for(;i<result.size();i++)
    {
        if(result[i])
        {
            break;
        }
    }
    // if(result.size()-i<a)
    // {
    //     return result;
    // }    //用这个函数前，必先check，所以这个检查是冗余的
    for(unsigned int j=0;j<num;j++)
    {
        result[i+j]=!result[i+j];
    }

    return result;
}